package com.cc8w.home.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;
import com.cc8w.entity.UserEntity;
import com.cc8w.home.mapper.UserHomeMapper;
import com.cc8w.home.service.UserService;


@Service(version = "1.0.0",timeout = 10000,interfaceClass=UserService.class) //注意：这里是dubbo的注解,这个等价于<dubbo:service...>
@Component //spring 的@service注解也可以用@Component
public class UserServiceImpl implements UserService {

    @Value("${dubbo.application.name}")
    private String serviceName;

    @Autowired
    private UserHomeMapper userMapper;

    @Override
    public String sayHi(String name) {
        return null;
    }

    @Override
    public UserEntity getUser(int id) {
        //测试乱写的,本来按id查,但没有只有按名字查了
        UserEntity user = userMapper.queryUserByUserName("fps2tao");
        return user;
    }




}